08. PR2 Collision Avoidance

PR2 Collision Avoidance

**NOTE: If you have successfully output .yaml files containing your ROS messages for the service request for all three scenarios (test1.world, test2.world and test3.world) you have already achieved a passing submission of this project! Go ahead and submit now, or keep reading to take on further challenges. **

To make PR2 aware of collidable objects like the table and objects on top of it, you must publish a point cloud which the motion planning pipeline can subscribe to and use it for a 3D collision map.

First, you need to tell the simulator, which topic you will be publishing this point cloud to.

For that, open the sensors.yaml file under /RoboND-Perception-Project/pr2_robot/config and change the parameter named point_cloud_topic from /pr2/voxel_grid/points to /pr2/3d_map/points.

Important Note: In order to run the project in demo mode, you must change the point_cloud_topic parameter back to /pr2/voxel_grid/points

Next, you need to publish a point cloud to /pr2/3D_map/points. By publishing this point cloud on this topic you are telling the robot where objects are in the environment in order to avoid collisions. Finally, you need to decide what should be passed as a collidable point cloud to the motion planning pipeline.

As we discussed earlier, the table should certainly be passed as we do not want PR2 to karate chop it, but what about the objects on top of it?

If the object to be picked is a part of the point cloud published over /pr2/3d_map/points, the motion planning pipeline will consider that object as collidable and will fail to produce a pickup plan.

On the other hand, if rest of the objects on top of the table are not published as part of that point cloud, the robot essentially won't be able to see them and most likely knock them over during its motion.

Keeping all that information in mind, let's go through a quick quiz to determine what your point cloud should consist of for optimum collision avoidance.

Point Cloud composition for collision map

Consider a test scene with three objects on top of the table:

  • object_1
  • object_2
  • object_3

The order of picking items as per the pick list is:

  1. object_2
  2. object_3
  3. object_1

What items should be in the point cloud you publish over /pr2/3d_map/points while trying to pickup object_3

SOLUTION:
  • Table
  • object_1

Point Cloud composition for collision map

What items should be in the point cloud you publish over /pr2/3d_map/points while trying to pickup object_1

SOLUTION:
  • Table

Next, we will take the recognized object and actually move the robot arms to perform the pick/place operation.